package com.lb.bs.client.processor.beans;

import java.util.stream.Stream;

/**
 * program: LB-BS-Client
 * author: bsworld.xie
 * create: 2019-12-19 11:48
 * description:
 */
public class ProcessorDynamicBean {

    private String key;

    private String data;
    /**
     * 是否处理回调
     */
    private boolean enableUpdateCallBack = false;

    public ProcessorDynamicBean(Builder builder) {
        this.key = builder.key;
        this.data = builder.data;
        this.enableUpdateCallBack = builder.enableUpdateCallBack;
    }

    public ProcessorDynamicBean(String key, String data, boolean enableUpdateCallBack) {
        this.key = key;
        this.data = data;
        this.enableUpdateCallBack = enableUpdateCallBack;
    }

    public static Builder builder() {
        return new Builder();
    }

    public String getKey() {
        return key;
    }

    public String getData() {
        return data;
    }

    public boolean isEnableUpdateCallBack() {
        return enableUpdateCallBack;
    }

    public static class Builder {

        private String key;

        private String data;
        /**
         * 是否处理回调
         */
        private boolean enableUpdateCallBack = false;



        public Builder key(String key) {
            this.key = key;
            return this;
        }

        public Builder data(String data) {
            this.data = data;
            return this;
        }

        public Builder enableUpdateCallBack(boolean enableUpdateCallBack) {
            this.enableUpdateCallBack = enableUpdateCallBack;
            return this;
        }

        public ProcessorDynamicBean build() {

            return new ProcessorDynamicBean(this);
        }

    }
}
